using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
namespace Ascent.Module.BusinessObjects.Base
{
  [DefaultClassOptions]
  [DevExpress.Persistent.Base.NavigationItemAttribute("基础数据")]
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("单位")]
  public partial class Unit : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private Ascent.Module.BusinessObjects.Base.Product _product;
    private System.String _remark;
    private System.String _name;
    public Unit(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("单位")]
    public System.String Name
    {
      get
      {
        return _name;
      }
      set
      {
        SetPropertyValue("Name", ref _name, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    public System.String Remark
    {
      get
      {
        return _remark;
      }
      set
      {
        SetPropertyValue("Remark", ref _remark, value);
      }
    }
    [System.ComponentModel.BrowsableAttribute(false)]
    public Ascent.Module.BusinessObjects.Base.Product Product
    {
      get
      {
        return _product;
      }
      set
      {
        if (_product == value)
          return;
        Ascent.Module.BusinessObjects.Base.Product prevProduct = _product;
        _product = value;
        if (IsLoading)
          return;
        if (prevProduct != null && prevProduct.Unit == this)
          prevProduct.Unit = null;
        if (_product != null)
          _product.Unit = this;
        OnChanged("Product");
      }
    }
  }
}
